import { lazy } from 'react';
import Layout from '@/layout';
import lazyLoad from '../components/lazyLoad';

export const UseApprove = lazy(
  () => import(/* webpackChunkName: "Use" */ '@/view/use/Approve/ApproveMain')
);
export const UseBorrow = lazy(
  () => import(/* webpackChunkName: "Use" */ '@/view/use/Borrow/BorrowMain')
);
export const UseRightApprove = lazy(
  () => import(/* webpackChunkName: "Use" */ '@/view/use/RightApprove/RightApproveMain')
);
export const UseRightApply = lazy(
  () => import(/* webpackChunkName: "Use" */ '@/view/use/RightApply/RightApplyMain')
);

/** 我的申请页面 */
export const UseMyApply = lazy(
  () => import(/* webpackChunkName: "Use" */ '@/view/use/MyApply/MyApplyMain')
);

/** 我的审核页面 */
export const UseMyApprovals = lazy(
  () => import(/* webpackChunkName: "Use" */ '@/view/use/MyApprovals/MyApprovalsMain')
);

const archiveUseRoutes: any[] = [
  {
    path: '/use',
    element: <Layout />,
    meta: {
      title: '档案利用'
    },
    children: [
      // {
      //   path: 'apply',
      //   element: <UseApply />,
      //   meta: {
      //     title: '利用申请'
      //   }
      // },
      {
        path: 'approve',
        element: lazyLoad(UseApprove),
        meta: {
          title: '利用审批与管理'
        }
      },
      {
        path: 'borrow',
        element: lazyLoad(UseBorrow),
        meta: {
          title: '我的借阅申请'
        }
      },
      {
        path: 'right-approve',
        element: lazyLoad(UseRightApprove),
        meta: {
          title: '权限审批'
        }
      },
      {
        path: 'right-apply',
        element: lazyLoad(UseRightApply),
        meta: {
          title: '我的权限申请'
        }
      }
    ]
  }
];

export default archiveUseRoutes;
